﻿using Newtonsoft.Json.Linq;

namespace Babelfish.JSON
{
    /// <summary>
    /// 
    /// </summary>
    public class JSONDocument: JSONNode, INodeDocument
    {
        /// <summary>
        /// Gets or sets the JSON object.
        /// </summary>
        /// <value>The JSON object.</value>
        private JObject JSONObject {get; set;}

        /// <summary>
        /// Initializes a new instance of the <see cref="JSONDocument"/> class.
        /// </summary>
        /// <param name="document">The document.</param>
        public JSONDocument(string document)
        {
            JSONObject = JObject.Parse(document);

            Token = JSONObject.Root;
        }
    }
}
